package com.tyler.java;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Demo1 {
    public static void main(String[] args) {
        try {
            // 获取 Process 实例
            Process process = Runtime.getRuntime().exec("git help");
            // 获取输入流
            BufferedReader result = new BufferedReader(new InputStreamReader(process.getInputStream()));
            String line;
            while ((line = result.readLine()) != null) {
                System.out.println(line);
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
